/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package abricots.entity.collision;

import abricots.entity.BallEntity;
import abricots.entity.Entity;
import abricots.entity.state.BasicEntityState;
import abricots.entity.state.EntityState;
import abricots.game.GameConstants;
import org.newdawn.slick.geom.Circle;
import org.newdawn.slick.geom.Shape;

/**
 *
 * @author charly
 */
public class BallCollisionManager implements EntityCollisionManager {
   private BallEntity ballEntity;

   public BallCollisionManager(BallEntity ballEntity) {
      this.ballEntity = ballEntity;
   }

   @Override
   public boolean isCollisionCheckNeeded(Entity entity) {
      switch (entity.getEntityTypeId()) {
         case GameConstants.ENTITY_TYPE_ID_SERVER:
            return true;
      }
      return false;
   }

   @Override
   public Shape getCollisionShape(EntityState state) {
      BasicEntityState basicEntityState = (BasicEntityState) state;
      return new Circle(basicEntityState.getPosX(), basicEntityState.getPosY(), 3);
   }

   @Override
   public void onCollision(Entity entity, long time) {
   }
}
